resource "google_compute_network_endpoint_group" "<%= ctx[:primary_resource_id] %>" {
  name         = "<%= ctx[:vars]['neg_name'] %>"
  network      = google_compute_network.default.id
  subnetwork   = google_compute_subnetwork.default.id
  default_port = "90"
  zone         = "us-central1-a"
}

resource "google_compute_network" "default" {
  name                    = "<%= ctx[:vars]['network_name'] %>"
  auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "default" {
  name          = "<%= ctx[:vars]['subnetwork_name'] %>"
  ip_cidr_range = "10.0.0.0/16"
  region        = "us-central1"
  network       = google_compute_network.default.id
}
